﻿using System;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using HYView;

namespace HangerSupport
{
	[Transaction(TransactionMode.Manual)]
	[Regeneration(RegenerationOption.Manual)]
	public class HSLabel : IExternalCommand
	{
		public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elems)
		{
			CmdViewType types = CmdViewType.FloorPlan;
			bool flag = SwitchView.SetUsableView(types, cmdData) > 0;
			Result result;
			if (flag)
			{
				result = Autodesk.Revit.UI.Result.Failed;
			}
			else
			{
				HSLabelManage hslabelManage = new HSLabelManage(cmdData.Application);
				hslabelManage.SetHSLabel();
				result = Autodesk.Revit.UI.Result.Succeeded;
			}
			return result;
		}
	}
}
